.class public Lcom/vividsolutions/jts/geomgraph/PlanarGraph;
.super Ljava/lang/Object;
.source "PlanarGraph.java"


# static fields
.field public static final cga:Lcom/vividsolutions/jts/algorithm/CGAlgorithms;


# instance fields
.field protected edgeEndList:Ljava/util/List;

.field protected edges:Ljava/util/List;

.field protected nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 66
    new-instance v0, Lcom/vividsolutions/jts/algorithm/CGAlgorithms;

    invoke-direct {v0}, Lcom/vividsolutions/jts/algorithm/CGAlgorithms;-><init>()V

    sput-object v0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->cga:Lcom/vividsolutions/jts/algorithm/CGAlgorithms;

    return-void
.end method

.method public constructor <init>()V
    .locals 2

    .line 89
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 81
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edges:Ljava/util/List;

    .line 83
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edgeEndList:Ljava/util/List;

    .line 90
    new-instance v0, Lcom/vividsolutions/jts/geomgraph/NodeMap;

    new-instance v1, Lcom/vividsolutions/jts/geomgraph/NodeFactory;

    invoke-direct {v1}, Lcom/vividsolutions/jts/geomgraph/NodeFactory;-><init>()V

    invoke-direct {v0, v1}, Lcom/vividsolutions/jts/geomgraph/NodeMap;-><init>(Lcom/vividsolutions/jts/geomgraph/NodeFactory;)V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;

    return-void
.end method

.method public constructor <init>(Lcom/vividsolutions/jts/geomgraph/NodeFactory;)V
    .locals 1

    .line 85
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 81
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edges:Ljava/util/List;

    .line 83
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edgeEndList:Ljava/util/List;

    .line 86
    new-instance v0, Lcom/vividsolutions/jts/geomgraph/NodeMap;

    invoke-direct {v0, p1}, Lcom/vividsolutions/jts/geomgraph/NodeMap;-><init>(Lcom/vividsolutions/jts/geomgraph/NodeFactory;)V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;

    return-void
.end method

.method public static linkResultDirectedEdges(Ljava/util/Collection;)V
    .locals 1

    .line 75
    invoke-interface {p0}, Ljava/util/Collection;->iterator()Ljava/util/Iterator;

    move-result-object p0

    :goto_0
    invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 76
    invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vividsolutions/jts/geomgraph/Node;

    .line 77
    invoke-virtual {v0}, Lcom/vividsolutions/jts/geomgraph/Node;->getEdges()Lcom/vividsolutions/jts/geomgraph/EdgeEndStar;

    move-result-object v0

    check-cast v0, Lcom/vividsolutions/jts/geomgraph/DirectedEdgeStar;

    invoke-virtual {v0}, Lcom/vividsolutions/jts/geomgraph/DirectedEdgeStar;->linkResultDirectedEdges()V

    goto :goto_0

    :cond_0
    return-void
.end method


# virtual methods
.method public add(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V
    .locals 1

    .line 110
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;

    invoke-virtual {v0, p1}, Lcom/vividsolutions/jts/geomgraph/NodeMap;->add(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V

    .line 111
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edgeEndList:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public addEdges(Ljava/util/List;)V
    .locals 4

    .line 130
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 131
    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/vividsolutions/jts/geomgraph/Edge;

    .line 132
    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edges:Ljava/util/List;

    invoke-interface {v1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 134
    new-instance v1, Lcom/vividsolutions/jts/geomgraph/DirectedEdge;

    const/4 v2, 0x1

    invoke-direct {v1, v0, v2}, Lcom/vividsolutions/jts/geomgraph/DirectedEdge;-><init>(Lcom/vividsolutions/jts/geomgraph/Edge;Z)V

    .line 135
    new-instance v2, Lcom/vividsolutions/jts/geomgraph/DirectedEdge;

    const/4 v3, 0x0

    invoke-direct {v2, v0, v3}, Lcom/vividsolutions/jts/geomgraph/DirectedEdge;-><init>(Lcom/vividsolutions/jts/geomgraph/Edge;Z)V

    .line 136
    invoke-virtual {v1, v2}, Lcom/vividsolutions/jts/geomgraph/DirectedEdge;->setSym(Lcom/vividsolutions/jts/geomgraph/DirectedEdge;)V

    .line 137
    invoke-virtual {v2, v1}, Lcom/vividsolutions/jts/geomgraph/DirectedEdge;->setSym(Lcom/vividsolutions/jts/geomgraph/DirectedEdge;)V

    .line 139
    invoke-virtual {p0, v1}, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->add(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V

    .line 140
    invoke-virtual {p0, v2}, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->add(Lcom/vividsolutions/jts/geomgraph/EdgeEnd;)V

    goto :goto_0

    :cond_0
    return-void
.end method

.method public getEdgeIterator()Ljava/util/Iterator;
    .locals 1

    .line 93
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edges:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    return-object v0
.end method

.method public getNodeIterator()Ljava/util/Iterator;
    .locals 1

    .line 114
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;

    invoke-virtual {v0}, Lcom/vividsolutions/jts/geomgraph/NodeMap;->iterator()Ljava/util/Iterator;

    move-result-object v0

    return-object v0
.end method

.method public getNodes()Ljava/util/Collection;
    .locals 1

    .line 115
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;

    invoke-virtual {v0}, Lcom/vividsolutions/jts/geomgraph/NodeMap;->values()Ljava/util/Collection;

    move-result-object v0

    return-object v0
.end method

.method protected insertEdge(Lcom/vividsolutions/jts/geomgraph/Edge;)V
    .locals 1

    .line 106
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->edges:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method public isBoundaryNode(ILcom/vividsolutions/jts/geom/Coordinate;)Z
    .locals 1

    .line 98
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/PlanarGraph;->nodes:Lcom/vividsolutions/jts/geomgraph/NodeMap;

    invoke-virtual {v0, p2}, Lcom/vividsolutions/jts/geomgraph/NodeMap;->find(Lcom/vividsolutions/jts/geom/Coordinate;)Lcom/vividsolutions/jts/geomgraph/Node;

    move-result-object p2

    const/4 v0, 0x0

    if-nez p2, :cond_0

    return v0

    .line 100
    :cond_0
    invoke-virtual {p2}, Lcom/vividsolutions/jts/geomgraph/GraphComponent;->getLabel()Lcom/vividsolutions/jts/geomgraph/Label;

    move-result-object p2

    if-eqz p2, :cond_1

    .line 101
    invoke-virtual {p2, p1}, Lcom/vividsolutions/jts/geomgraph/Label;->getLocation(I)I

    move-result p1

    const/4 p2, 0x1

    if-ne p1, p2, :cond_1

    return p2

    :cond_1
    return v0
.end method
